 /* Copyright 2018 JDCLOUD.COM

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http:#www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.





Contact: 

NOTE: This class is auto generated by the jdcloud code generator program.
*/


#import <Foundation/Foundation.h>
#import <JDCloudOCSDKAntipro/AntiproModel.h>

@implementation IpResource
-(id) initWithRegion:(NSString*) region
      resourceType:(NSNumber*)resourceType
      ip:(NSString*)ip
      bandwidth:(NSNumber*)bandwidth
      cleanThresholdBps:(NSNumber*)cleanThresholdBps
      cleanThresholdPps:(NSNumber*)cleanThresholdPps
      balckHoleThreshold:(NSNumber*)balckHoleThreshold
      instanceId:(NSString*)instanceId
      instanceName:(NSString*)instanceName
      safeStatus:(NSNumber*)safeStatus { 
     self.region = region;               
     self.resourceType = resourceType;               
     self.ip = ip;               
     self.bandwidth = bandwidth;               
     self.cleanThresholdBps = cleanThresholdBps;               
     self.cleanThresholdPps = cleanThresholdPps;               
     self.balckHoleThreshold = balckHoleThreshold;               
     self.instanceId = instanceId;               
     self.instanceName = instanceName;               
     self.safeStatus = safeStatus;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self region])
    {
        [result setValue:[self region] forKey:@"region"];
    }
    if([self resourceType])
    {
        [result setValue:[self resourceType] forKey:@"resourceType"];
    }
    if([self ip])
    {
        [result setValue:[self ip] forKey:@"ip"];
    }
    if([self bandwidth])
    {
        [result setValue:[self bandwidth] forKey:@"bandwidth"];
    }
    if([self cleanThresholdBps])
    {
        [result setValue:[self cleanThresholdBps] forKey:@"cleanThresholdBps"];
    }
    if([self cleanThresholdPps])
    {
        [result setValue:[self cleanThresholdPps] forKey:@"cleanThresholdPps"];
    }
    if([self balckHoleThreshold])
    {
        [result setValue:[self balckHoleThreshold] forKey:@"balckHoleThreshold"];
    }
    if([self instanceId])
    {
        [result setValue:[self instanceId] forKey:@"instanceId"];
    }
    if([self instanceName])
    {
        [result setValue:[self instanceName] forKey:@"instanceName"];
    }
    if([self safeStatus])
    {
        [result setValue:[self safeStatus] forKey:@"safeStatus"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.region = [dictionary objectForKey:@"region"];
    self.resourceType = [dictionary objectForKey:@"resourceType"];
    self.ip = [dictionary objectForKey:@"ip"];
    self.bandwidth = [dictionary objectForKey:@"bandwidth"];
    self.cleanThresholdBps = [dictionary objectForKey:@"cleanThresholdBps"];
    self.cleanThresholdPps = [dictionary objectForKey:@"cleanThresholdPps"];
    self.balckHoleThreshold = [dictionary objectForKey:@"balckHoleThreshold"];
    self.instanceId = [dictionary objectForKey:@"instanceId"];
    self.instanceName = [dictionary objectForKey:@"instanceName"];
    self.safeStatus = [dictionary objectForKey:@"safeStatus"];
    return self;
}
 @end
@implementation ModifyInstanceSpec
-(id) initWithIpNum:(NSNumber*) ipNum
      bpGbps:(NSNumber*)bpGbps
      epGbps:(NSNumber*)epGbps { 
     self.ipNum = ipNum;               
     self.bpGbps = bpGbps;               
     self.epGbps = epGbps;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self ipNum])
    {
        [result setValue:[self ipNum] forKey:@"ipNum"];
    }
    if([self bpGbps])
    {
        [result setValue:[self bpGbps] forKey:@"bpGbps"];
    }
    if([self epGbps])
    {
        [result setValue:[self epGbps] forKey:@"epGbps"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.ipNum = [dictionary objectForKey:@"ipNum"];
    self.bpGbps = [dictionary objectForKey:@"bpGbps"];
    self.epGbps = [dictionary objectForKey:@"epGbps"];
    return self;
}
 @end
@implementation OperationRecord
-(id) initWithTime:(NSString*) time
      name:(NSString*)name
      action:(NSNumber*)action
      info:(NSString*)info
      operatorValue:(NSString*)operatorValue { 
     self.time = time;               
     self.name = name;               
     self.action = action;               
     self.info = info;               
     self.operatorValue = operatorValue;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self time])
    {
        [result setValue:[self time] forKey:@"time"];
    }
    if([self name])
    {
        [result setValue:[self name] forKey:@"name"];
    }
    if([self action])
    {
        [result setValue:[self action] forKey:@"action"];
    }
    if([self info])
    {
        [result setValue:[self info] forKey:@"info"];
    }
    if([self operatorValue])
    {
        [result setValue:[self operatorValue] forKey:@"operator"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.time = [dictionary objectForKey:@"time"];
    self.name = [dictionary objectForKey:@"name"];
    self.action = [dictionary objectForKey:@"action"];
    self.info = [dictionary objectForKey:@"info"];
    self.operatorValue = [dictionary objectForKey:@"operator"];
    return self;
}
 @end
@implementation AttackTypeCount
-(id) initWithType:(NSString*) type
      count:(NSNumber*)count { 
     self.type = type;               
     self.count = count;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self type])
    {
        [result setValue:[self type] forKey:@"type"];
    }
    if([self count])
    {
        [result setValue:[self count] forKey:@"count"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.type = [dictionary objectForKey:@"type"];
    self.count = [dictionary objectForKey:@"count"];
    return self;
}
 @end
@implementation ProtectedIpSpec
-(id) initWithIp:(NSArray<NSString*>*) ip { 
     self.ip = ip;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self ip])
    {
        [result setValue:[self ip] forKey:@"ip"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.ip = [dictionary objectForKey:@"ip"];
    return self;
}
 @end
@implementation ProtectionOutline
-(id) initWithProtectedDay:(NSNumber*) protectedDay
      protectedIpCount:(NSNumber*)protectedIpCount
      weekAttackCount:(NSNumber*)weekAttackCount
      weekAttackPeak:(NSNumber*)weekAttackPeak
      weekAttackUnit:(NSString*)weekAttackUnit
      monthAttackCount:(NSNumber*)monthAttackCount
      monthAttackPeak:(NSNumber*)monthAttackPeak
      monthAttackUnit:(NSString*)monthAttackUnit
      currentAttackCount:(NSNumber*)currentAttackCount { 
     self.protectedDay = protectedDay;               
     self.protectedIpCount = protectedIpCount;               
     self.weekAttackCount = weekAttackCount;               
     self.weekAttackPeak = weekAttackPeak;               
     self.weekAttackUnit = weekAttackUnit;               
     self.monthAttackCount = monthAttackCount;               
     self.monthAttackPeak = monthAttackPeak;               
     self.monthAttackUnit = monthAttackUnit;               
     self.currentAttackCount = currentAttackCount;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self protectedDay])
    {
        [result setValue:[self protectedDay] forKey:@"protectedDay"];
    }
    if([self protectedIpCount])
    {
        [result setValue:[self protectedIpCount] forKey:@"protectedIpCount"];
    }
    if([self weekAttackCount])
    {
        [result setValue:[self weekAttackCount] forKey:@"weekAttackCount"];
    }
    if([self weekAttackPeak])
    {
        [result setValue:[self weekAttackPeak] forKey:@"weekAttackPeak"];
    }
    if([self weekAttackUnit])
    {
        [result setValue:[self weekAttackUnit] forKey:@"weekAttackUnit"];
    }
    if([self monthAttackCount])
    {
        [result setValue:[self monthAttackCount] forKey:@"monthAttackCount"];
    }
    if([self monthAttackPeak])
    {
        [result setValue:[self monthAttackPeak] forKey:@"monthAttackPeak"];
    }
    if([self monthAttackUnit])
    {
        [result setValue:[self monthAttackUnit] forKey:@"monthAttackUnit"];
    }
    if([self currentAttackCount])
    {
        [result setValue:[self currentAttackCount] forKey:@"currentAttackCount"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.protectedDay = [dictionary objectForKey:@"protectedDay"];
    self.protectedIpCount = [dictionary objectForKey:@"protectedIpCount"];
    self.weekAttackCount = [dictionary objectForKey:@"weekAttackCount"];
    self.weekAttackPeak = [dictionary objectForKey:@"weekAttackPeak"];
    self.weekAttackUnit = [dictionary objectForKey:@"weekAttackUnit"];
    self.monthAttackCount = [dictionary objectForKey:@"monthAttackCount"];
    self.monthAttackPeak = [dictionary objectForKey:@"monthAttackPeak"];
    self.monthAttackUnit = [dictionary objectForKey:@"monthAttackUnit"];
    self.currentAttackCount = [dictionary objectForKey:@"currentAttackCount"];
    return self;
}
 @end
@implementation ProtectionRuleSpec
-(id) initWithIp:(NSString*) ip
      type:(NSNumber*)type
      cleanThresholdBps:(NSNumber*)cleanThresholdBps
      cleanThresholdPps:(NSNumber*)cleanThresholdPps
      spoofIpEnable:(NSNumber*)spoofIpEnable
      srcNewConnLimitEnable:(NSNumber*)srcNewConnLimitEnable
      srcNewConnLimitValue:(NSNumber*)srcNewConnLimitValue
      dstNewConnLimitEnable:(NSNumber*)dstNewConnLimitEnable
      dstNewConnLimitValue:(NSNumber*)dstNewConnLimitValue
      datagramRangeMin:(NSNumber*)datagramRangeMin
      datagramRangeMax:(NSNumber*)datagramRangeMax
      geoBlackList:(NSArray<NSString*>*)geoBlackList
      ipBlackList:(NSArray<NSString*>*)ipBlackList
      ipWhiteList:(NSArray<NSString*>*)ipWhiteList { 
     self.ip = ip;               
     self.type = type;               
     self.cleanThresholdBps = cleanThresholdBps;               
     self.cleanThresholdPps = cleanThresholdPps;               
     self.spoofIpEnable = spoofIpEnable;               
     self.srcNewConnLimitEnable = srcNewConnLimitEnable;               
     self.srcNewConnLimitValue = srcNewConnLimitValue;               
     self.dstNewConnLimitEnable = dstNewConnLimitEnable;               
     self.dstNewConnLimitValue = dstNewConnLimitValue;               
     self.datagramRangeMin = datagramRangeMin;               
     self.datagramRangeMax = datagramRangeMax;               
     self.geoBlackList = geoBlackList;               
     self.ipBlackList = ipBlackList;               
     self.ipWhiteList = ipWhiteList;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self ip])
    {
        [result setValue:[self ip] forKey:@"ip"];
    }
    if([self type])
    {
        [result setValue:[self type] forKey:@"type"];
    }
    if([self cleanThresholdBps])
    {
        [result setValue:[self cleanThresholdBps] forKey:@"cleanThresholdBps"];
    }
    if([self cleanThresholdPps])
    {
        [result setValue:[self cleanThresholdPps] forKey:@"cleanThresholdPps"];
    }
    if([self spoofIpEnable])
    {
        [result setValue:[self spoofIpEnable] forKey:@"spoofIpEnable"];
    }
    if([self srcNewConnLimitEnable])
    {
        [result setValue:[self srcNewConnLimitEnable] forKey:@"srcNewConnLimitEnable"];
    }
    if([self srcNewConnLimitValue])
    {
        [result setValue:[self srcNewConnLimitValue] forKey:@"srcNewConnLimitValue"];
    }
    if([self dstNewConnLimitEnable])
    {
        [result setValue:[self dstNewConnLimitEnable] forKey:@"dstNewConnLimitEnable"];
    }
    if([self dstNewConnLimitValue])
    {
        [result setValue:[self dstNewConnLimitValue] forKey:@"dstNewConnLimitValue"];
    }
    if([self datagramRangeMin])
    {
        [result setValue:[self datagramRangeMin] forKey:@"datagramRangeMin"];
    }
    if([self datagramRangeMax])
    {
        [result setValue:[self datagramRangeMax] forKey:@"datagramRangeMax"];
    }
    if([self geoBlackList])
    {
        [result setValue:[self geoBlackList] forKey:@"geoBlackList"];
    }
    if([self ipBlackList])
    {
        [result setValue:[self ipBlackList] forKey:@"ipBlackList"];
    }
    if([self ipWhiteList])
    {
        [result setValue:[self ipWhiteList] forKey:@"ipWhiteList"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.ip = [dictionary objectForKey:@"ip"];
    self.type = [dictionary objectForKey:@"type"];
    self.cleanThresholdBps = [dictionary objectForKey:@"cleanThresholdBps"];
    self.cleanThresholdPps = [dictionary objectForKey:@"cleanThresholdPps"];
    self.spoofIpEnable = [dictionary objectForKey:@"spoofIpEnable"];
    self.srcNewConnLimitEnable = [dictionary objectForKey:@"srcNewConnLimitEnable"];
    self.srcNewConnLimitValue = [dictionary objectForKey:@"srcNewConnLimitValue"];
    self.dstNewConnLimitEnable = [dictionary objectForKey:@"dstNewConnLimitEnable"];
    self.dstNewConnLimitValue = [dictionary objectForKey:@"dstNewConnLimitValue"];
    self.datagramRangeMin = [dictionary objectForKey:@"datagramRangeMin"];
    self.datagramRangeMax = [dictionary objectForKey:@"datagramRangeMax"];
    self.geoBlackList = [dictionary objectForKey:@"geoBlackList"];
    self.ipBlackList = [dictionary objectForKey:@"ipBlackList"];
    self.ipWhiteList = [dictionary objectForKey:@"ipWhiteList"];
    return self;
}
 @end
@implementation AttackLog
-(id) initWithIp:(NSString*) ip
      resourceType:(NSNumber*)resourceType
      attackLogId:(NSString*)attackLogId
      startTime:(NSString*)startTime
      endTime:(NSString*)endTime
      cause:(NSNumber*)cause
      status:(NSNumber*)status
      blackHole:(NSNumber*)blackHole
      peak:(NSNumber*)peak
      unit:(NSString*)unit
      attackType:(NSArray<NSString*>*)attackType { 
     self.ip = ip;               
     self.resourceType = resourceType;               
     self.attackLogId = attackLogId;               
     self.startTime = startTime;               
     self.endTime = endTime;               
     self.cause = cause;               
     self.status = status;               
     self.blackHole = blackHole;               
     self.peak = peak;               
     self.unit = unit;               
     self.attackType = attackType;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self ip])
    {
        [result setValue:[self ip] forKey:@"ip"];
    }
    if([self resourceType])
    {
        [result setValue:[self resourceType] forKey:@"resourceType"];
    }
    if([self attackLogId])
    {
        [result setValue:[self attackLogId] forKey:@"attackLogId"];
    }
    if([self startTime])
    {
        [result setValue:[self startTime] forKey:@"startTime"];
    }
    if([self endTime])
    {
        [result setValue:[self endTime] forKey:@"endTime"];
    }
    if([self cause])
    {
        [result setValue:[self cause] forKey:@"cause"];
    }
    if([self status])
    {
        [result setValue:[self status] forKey:@"status"];
    }
    if([self blackHole])
    {
        [result setValue:[self blackHole] forKey:@"blackHole"];
    }
    if([self peak])
    {
        [result setValue:[self peak] forKey:@"peak"];
    }
    if([self unit])
    {
        [result setValue:[self unit] forKey:@"unit"];
    }
    if([self attackType])
    {
        [result setValue:[self attackType] forKey:@"attackType"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.ip = [dictionary objectForKey:@"ip"];
    self.resourceType = [dictionary objectForKey:@"resourceType"];
    self.attackLogId = [dictionary objectForKey:@"attackLogId"];
    self.startTime = [dictionary objectForKey:@"startTime"];
    self.endTime = [dictionary objectForKey:@"endTime"];
    self.cause = [dictionary objectForKey:@"cause"];
    self.status = [dictionary objectForKey:@"status"];
    self.blackHole = [dictionary objectForKey:@"blackHole"];
    self.peak = [dictionary objectForKey:@"peak"];
    self.unit = [dictionary objectForKey:@"unit"];
    self.attackType = [dictionary objectForKey:@"attackType"];
    return self;
}
 @end
@implementation PriceSpec
-(id) initWithBuyType:(NSNumber*) buyType
      idValue:(NSNumber*)idValue
      billingType:(NSNumber*)billingType
      pkgType:(NSNumber*)pkgType
      ipNum:(NSNumber*)ipNum
      bp:(NSNumber*)bp
      ep:(NSNumber*)ep
      timeSpan:(NSNumber*)timeSpan
      timeUnit:(NSNumber*)timeUnit { 
     self.buyType = buyType;               
     self.idValue = idValue;               
     self.billingType = billingType;               
     self.pkgType = pkgType;               
     self.ipNum = ipNum;               
     self.bp = bp;               
     self.ep = ep;               
     self.timeSpan = timeSpan;               
     self.timeUnit = timeUnit;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self buyType])
    {
        [result setValue:[self buyType] forKey:@"buyType"];
    }
    if([self idValue])
    {
        [result setValue:[self idValue] forKey:@"id"];
    }
    if([self billingType])
    {
        [result setValue:[self billingType] forKey:@"billingType"];
    }
    if([self pkgType])
    {
        [result setValue:[self pkgType] forKey:@"pkgType"];
    }
    if([self ipNum])
    {
        [result setValue:[self ipNum] forKey:@"ipNum"];
    }
    if([self bp])
    {
        [result setValue:[self bp] forKey:@"bp"];
    }
    if([self ep])
    {
        [result setValue:[self ep] forKey:@"ep"];
    }
    if([self timeSpan])
    {
        [result setValue:[self timeSpan] forKey:@"timeSpan"];
    }
    if([self timeUnit])
    {
        [result setValue:[self timeUnit] forKey:@"timeUnit"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.buyType = [dictionary objectForKey:@"buyType"];
    self.idValue = [dictionary objectForKey:@"id"];
    self.billingType = [dictionary objectForKey:@"billingType"];
    self.pkgType = [dictionary objectForKey:@"pkgType"];
    self.ipNum = [dictionary objectForKey:@"ipNum"];
    self.bp = [dictionary objectForKey:@"bp"];
    self.ep = [dictionary objectForKey:@"ep"];
    self.timeSpan = [dictionary objectForKey:@"timeSpan"];
    self.timeUnit = [dictionary objectForKey:@"timeUnit"];
    return self;
}
 @end
@implementation ProtectedIp
-(id) initWithIp:(NSString*) ip
      safeStatus:(NSNumber*)safeStatus
      resourceType:(NSNumber*)resourceType
      protectionRuleType:(NSNumber*)protectionRuleType { 
     self.ip = ip;               
     self.safeStatus = safeStatus;               
     self.resourceType = resourceType;               
     self.protectionRuleType = protectionRuleType;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self ip])
    {
        [result setValue:[self ip] forKey:@"ip"];
    }
    if([self safeStatus])
    {
        [result setValue:[self safeStatus] forKey:@"safeStatus"];
    }
    if([self resourceType])
    {
        [result setValue:[self resourceType] forKey:@"resourceType"];
    }
    if([self protectionRuleType])
    {
        [result setValue:[self protectionRuleType] forKey:@"protectionRuleType"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.ip = [dictionary objectForKey:@"ip"];
    self.safeStatus = [dictionary objectForKey:@"safeStatus"];
    self.resourceType = [dictionary objectForKey:@"resourceType"];
    self.protectionRuleType = [dictionary objectForKey:@"protectionRuleType"];
    return self;
}
 @end
@implementation GeoBlack
-(id) initWithLabel:(NSString*) label
      value:(NSString*)value { 
     self.label = label;               
     self.value = value;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self label])
    {
        [result setValue:[self label] forKey:@"label"];
    }
    if([self value])
    {
        [result setValue:[self value] forKey:@"value"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.label = [dictionary objectForKey:@"label"];
    self.value = [dictionary objectForKey:@"value"];
    return self;
}
 @end
@implementation ProtectedObjectsSpec
-(id) initWithEip:(NSNumber*) eip
      cps:(NSNumber*)cps { 
     self.eip = eip;               
     self.cps = cps;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self eip])
    {
        [result setValue:[self eip] forKey:@"eip"];
    }
    if([self cps])
    {
        [result setValue:[self cps] forKey:@"cps"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.eip = [dictionary objectForKey:@"eip"];
    self.cps = [dictionary objectForKey:@"cps"];
    return self;
}
 @end
@implementation OrderSpec
-(id) initWithBuyType:(NSNumber*) buyType
      idValue:(NSString*)idValue
      name:(NSString*)name
      pkgType:(NSNumber*)pkgType
      ipNum:(NSNumber*)ipNum
      bp:(NSNumber*)bp
      ep:(NSNumber*)ep
      timeSpan:(NSNumber*)timeSpan
      timeUnit:(NSNumber*)timeUnit
      returnUrl:(NSString*)returnUrl { 
     self.buyType = buyType;               
     self.idValue = idValue;               
     self.name = name;               
     self.pkgType = pkgType;               
     self.ipNum = ipNum;               
     self.bp = bp;               
     self.ep = ep;               
     self.timeSpan = timeSpan;               
     self.timeUnit = timeUnit;               
     self.returnUrl = returnUrl;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self buyType])
    {
        [result setValue:[self buyType] forKey:@"buyType"];
    }
    if([self idValue])
    {
        [result setValue:[self idValue] forKey:@"id"];
    }
    if([self name])
    {
        [result setValue:[self name] forKey:@"name"];
    }
    if([self pkgType])
    {
        [result setValue:[self pkgType] forKey:@"pkgType"];
    }
    if([self ipNum])
    {
        [result setValue:[self ipNum] forKey:@"ipNum"];
    }
    if([self bp])
    {
        [result setValue:[self bp] forKey:@"bp"];
    }
    if([self ep])
    {
        [result setValue:[self ep] forKey:@"ep"];
    }
    if([self timeSpan])
    {
        [result setValue:[self timeSpan] forKey:@"timeSpan"];
    }
    if([self timeUnit])
    {
        [result setValue:[self timeUnit] forKey:@"timeUnit"];
    }
    if([self returnUrl])
    {
        [result setValue:[self returnUrl] forKey:@"returnUrl"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.buyType = [dictionary objectForKey:@"buyType"];
    self.idValue = [dictionary objectForKey:@"id"];
    self.name = [dictionary objectForKey:@"name"];
    self.pkgType = [dictionary objectForKey:@"pkgType"];
    self.ipNum = [dictionary objectForKey:@"ipNum"];
    self.bp = [dictionary objectForKey:@"bp"];
    self.ep = [dictionary objectForKey:@"ep"];
    self.timeSpan = [dictionary objectForKey:@"timeSpan"];
    self.timeUnit = [dictionary objectForKey:@"timeUnit"];
    self.returnUrl = [dictionary objectForKey:@"returnUrl"];
    return self;
}
 @end
@implementation ModifyInstanceNameSpec
-(id) initWithName:(NSString*) name { 
     self.name = name;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self name])
    {
        [result setValue:[self name] forKey:@"name"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.name = [dictionary objectForKey:@"name"];
    return self;
}
 @end
@implementation ExtraOperationSpec
-(id) initWithOperationType:(NSNumber*) operationType
      ip:(NSString*)ip { 
     self.operationType = operationType;               
     self.ip = ip;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self operationType])
    {
        [result setValue:[self operationType] forKey:@"operationType"];
    }
    if([self ip])
    {
        [result setValue:[self ip] forKey:@"ip"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.operationType = [dictionary objectForKey:@"operationType"];
    self.ip = [dictionary objectForKey:@"ip"];
    return self;
}
 @end
@implementation CreateInstanceSpec
-(id) initWithName:(NSString*) name
      ipNum:(NSNumber*)ipNum
      bpGbps:(NSNumber*)bpGbps
      epGbps:(NSNumber*)epGbps
      timeSpan:(NSNumber*)timeSpan
      timeUnit:(NSNumber*)timeUnit { 
     self.name = name;               
     self.ipNum = ipNum;               
     self.bpGbps = bpGbps;               
     self.epGbps = epGbps;               
     self.timeSpan = timeSpan;               
     self.timeUnit = timeUnit;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self name])
    {
        [result setValue:[self name] forKey:@"name"];
    }
    if([self ipNum])
    {
        [result setValue:[self ipNum] forKey:@"ipNum"];
    }
    if([self bpGbps])
    {
        [result setValue:[self bpGbps] forKey:@"bpGbps"];
    }
    if([self epGbps])
    {
        [result setValue:[self epGbps] forKey:@"epGbps"];
    }
    if([self timeSpan])
    {
        [result setValue:[self timeSpan] forKey:@"timeSpan"];
    }
    if([self timeUnit])
    {
        [result setValue:[self timeUnit] forKey:@"timeUnit"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.name = [dictionary objectForKey:@"name"];
    self.ipNum = [dictionary objectForKey:@"ipNum"];
    self.bpGbps = [dictionary objectForKey:@"bpGbps"];
    self.epGbps = [dictionary objectForKey:@"epGbps"];
    self.timeSpan = [dictionary objectForKey:@"timeSpan"];
    self.timeUnit = [dictionary objectForKey:@"timeUnit"];
    return self;
}
 @end
@implementation IpResourceInfo
-(id) initWithIp:(NSString*) ip
      safeStatus:(NSNumber*)safeStatus
      region:(NSString*)region
      blackHoleThreshold:(NSNumber*)blackHoleThreshold
      cleanThresholdBps:(NSNumber*)cleanThresholdBps
      cleanThresholdPps:(NSNumber*)cleanThresholdPps { 
     self.ip = ip;               
     self.safeStatus = safeStatus;               
     self.region = region;               
     self.blackHoleThreshold = blackHoleThreshold;               
     self.cleanThresholdBps = cleanThresholdBps;               
     self.cleanThresholdPps = cleanThresholdPps;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self ip])
    {
        [result setValue:[self ip] forKey:@"ip"];
    }
    if([self safeStatus])
    {
        [result setValue:[self safeStatus] forKey:@"safeStatus"];
    }
    if([self region])
    {
        [result setValue:[self region] forKey:@"region"];
    }
    if([self blackHoleThreshold])
    {
        [result setValue:[self blackHoleThreshold] forKey:@"blackHoleThreshold"];
    }
    if([self cleanThresholdBps])
    {
        [result setValue:[self cleanThresholdBps] forKey:@"cleanThresholdBps"];
    }
    if([self cleanThresholdPps])
    {
        [result setValue:[self cleanThresholdPps] forKey:@"cleanThresholdPps"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.ip = [dictionary objectForKey:@"ip"];
    self.safeStatus = [dictionary objectForKey:@"safeStatus"];
    self.region = [dictionary objectForKey:@"region"];
    self.blackHoleThreshold = [dictionary objectForKey:@"blackHoleThreshold"];
    self.cleanThresholdBps = [dictionary objectForKey:@"cleanThresholdBps"];
    self.cleanThresholdPps = [dictionary objectForKey:@"cleanThresholdPps"];
    return self;
}
 @end
@implementation IpResourceFlow
-(id) initWithTime:(NSArray<NSString*>*) time
      postProtect:(NSArray<NSNumber*>*)postProtect
      preProtect:(NSArray<NSNumber*>*)preProtect
      unit:(NSString*)unit { 
     self.time = time;               
     self.postProtect = postProtect;               
     self.preProtect = preProtect;               
     self.unit = unit;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self time])
    {
        [result setValue:[self time] forKey:@"time"];
    }
    if([self postProtect])
    {
        [result setValue:[self postProtect] forKey:@"postProtect"];
    }
    if([self preProtect])
    {
        [result setValue:[self preProtect] forKey:@"preProtect"];
    }
    if([self unit])
    {
        [result setValue:[self unit] forKey:@"unit"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.time = [dictionary objectForKey:@"time"];
    self.postProtect = [dictionary objectForKey:@"postProtect"];
    self.preProtect = [dictionary objectForKey:@"preProtect"];
    self.unit = [dictionary objectForKey:@"unit"];
    return self;
}
 @end
@implementation ProtectedObject
-(id) initWithType:(NSString*) type
      count:(NSNumber*)count
      ipList:(NSArray<ProtectedIp*>*)ipList { 
     self.type = type;               
     self.count = count;               
     self.ipList = ipList;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self type])
    {
        [result setValue:[self type] forKey:@"type"];
    }
    if([self count])
    {
        [result setValue:[self count] forKey:@"count"];
    }
    if([self ipList])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self ipList] count]; i++) {
            ProtectedIp* item = [[self ipList] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"ipList"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.type = [dictionary objectForKey:@"type"];
    self.count = [dictionary objectForKey:@"count"];
    NSArray* ipListArray = [dictionary objectForKey:@"ipList"];
    if(ipListArray&&![ipListArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [ipListArray count];i++)
        {
            ProtectedIp* item = [[ProtectedIp alloc]initWithDic:[ipListArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.ipList = propertyArray;
    }
    return self;
}
 @end
@implementation Instance
-(id) initWithId:(NSString*) idValue
      name:(NSString*)name
      region:(NSString*)region
      type:(NSNumber*)type
      ipCount:(NSNumber*)ipCount
      basicBandwidth:(NSNumber*)basicBandwidth
      elasticBandwidth:(NSNumber*)elasticBandwidth
      expireTime:(NSString*)expireTime
      createTime:(NSString*)createTime
      protectedObjects:(NSArray<ProtectedObject*>*)protectedObjects
      onTrial:(NSNumber*)onTrial
      resourceId:(NSString*)resourceId { 
     self.idValue = idValue;               
     self.name = name;               
     self.region = region;               
     self.type = type;               
     self.ipCount = ipCount;               
     self.basicBandwidth = basicBandwidth;               
     self.elasticBandwidth = elasticBandwidth;               
     self.expireTime = expireTime;               
     self.createTime = createTime;               
     self.protectedObjects = protectedObjects;               
     self.onTrial = onTrial;               
     self.resourceId = resourceId;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self idValue])
    {
        [result setValue:[self idValue] forKey:@"id"];
    }
    if([self name])
    {
        [result setValue:[self name] forKey:@"name"];
    }
    if([self region])
    {
        [result setValue:[self region] forKey:@"region"];
    }
    if([self type])
    {
        [result setValue:[self type] forKey:@"type"];
    }
    if([self ipCount])
    {
        [result setValue:[self ipCount] forKey:@"ipCount"];
    }
    if([self basicBandwidth])
    {
        [result setValue:[self basicBandwidth] forKey:@"basicBandwidth"];
    }
    if([self elasticBandwidth])
    {
        [result setValue:[self elasticBandwidth] forKey:@"elasticBandwidth"];
    }
    if([self expireTime])
    {
        [result setValue:[self expireTime] forKey:@"expireTime"];
    }
    if([self createTime])
    {
        [result setValue:[self createTime] forKey:@"createTime"];
    }
    if([self protectedObjects])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self protectedObjects] count]; i++) {
            ProtectedObject* item = [[self protectedObjects] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"protectedObjects"];
    }
    if([self onTrial])
    {
        [result setValue:[self onTrial] forKey:@"onTrial"];
    }
    if([self resourceId])
    {
        [result setValue:[self resourceId] forKey:@"resourceId"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.idValue = [dictionary objectForKey:@"id"];
    self.name = [dictionary objectForKey:@"name"];
    self.region = [dictionary objectForKey:@"region"];
    self.type = [dictionary objectForKey:@"type"];
    self.ipCount = [dictionary objectForKey:@"ipCount"];
    self.basicBandwidth = [dictionary objectForKey:@"basicBandwidth"];
    self.elasticBandwidth = [dictionary objectForKey:@"elasticBandwidth"];
    self.expireTime = [dictionary objectForKey:@"expireTime"];
    self.createTime = [dictionary objectForKey:@"createTime"];
    NSArray* protectedObjectsArray = [dictionary objectForKey:@"protectedObjects"];
    if(protectedObjectsArray&&![protectedObjectsArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [protectedObjectsArray count];i++)
        {
            ProtectedObject* item = [[ProtectedObject alloc]initWithDic:[protectedObjectsArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.protectedObjects = propertyArray;
    }
    self.onTrial = [dictionary objectForKey:@"onTrial"];
    self.resourceId = [dictionary objectForKey:@"resourceId"];
    return self;
}
 @end
@implementation ProtectionRule
-(id) initWithType:(NSNumber*) type
      cleanThresholdBps:(NSNumber*)cleanThresholdBps
      cleanThresholdPps:(NSNumber*)cleanThresholdPps
      spoofIpEnable:(NSNumber*)spoofIpEnable
      srcNewConnLimitEnable:(NSNumber*)srcNewConnLimitEnable
      srcNewConnLimitValue:(NSNumber*)srcNewConnLimitValue
      dstNewConnLimitEnable:(NSNumber*)dstNewConnLimitEnable
      dstNewConnLimitValue:(NSNumber*)dstNewConnLimitValue
      datagramRangeMin:(NSNumber*)datagramRangeMin
      datagramRangeMax:(NSNumber*)datagramRangeMax
      geoBlackList:(NSArray<GeoBlack*>*)geoBlackList
      ipBlackList:(NSArray<NSString*>*)ipBlackList
      ipWhiteList:(NSArray<NSString*>*)ipWhiteList { 
     self.type = type;               
     self.cleanThresholdBps = cleanThresholdBps;               
     self.cleanThresholdPps = cleanThresholdPps;               
     self.spoofIpEnable = spoofIpEnable;               
     self.srcNewConnLimitEnable = srcNewConnLimitEnable;               
     self.srcNewConnLimitValue = srcNewConnLimitValue;               
     self.dstNewConnLimitEnable = dstNewConnLimitEnable;               
     self.dstNewConnLimitValue = dstNewConnLimitValue;               
     self.datagramRangeMin = datagramRangeMin;               
     self.datagramRangeMax = datagramRangeMax;               
     self.geoBlackList = geoBlackList;               
     self.ipBlackList = ipBlackList;               
     self.ipWhiteList = ipWhiteList;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self type])
    {
        [result setValue:[self type] forKey:@"type"];
    }
    if([self cleanThresholdBps])
    {
        [result setValue:[self cleanThresholdBps] forKey:@"cleanThresholdBps"];
    }
    if([self cleanThresholdPps])
    {
        [result setValue:[self cleanThresholdPps] forKey:@"cleanThresholdPps"];
    }
    if([self spoofIpEnable])
    {
        [result setValue:[self spoofIpEnable] forKey:@"spoofIpEnable"];
    }
    if([self srcNewConnLimitEnable])
    {
        [result setValue:[self srcNewConnLimitEnable] forKey:@"srcNewConnLimitEnable"];
    }
    if([self srcNewConnLimitValue])
    {
        [result setValue:[self srcNewConnLimitValue] forKey:@"srcNewConnLimitValue"];
    }
    if([self dstNewConnLimitEnable])
    {
        [result setValue:[self dstNewConnLimitEnable] forKey:@"dstNewConnLimitEnable"];
    }
    if([self dstNewConnLimitValue])
    {
        [result setValue:[self dstNewConnLimitValue] forKey:@"dstNewConnLimitValue"];
    }
    if([self datagramRangeMin])
    {
        [result setValue:[self datagramRangeMin] forKey:@"datagramRangeMin"];
    }
    if([self datagramRangeMax])
    {
        [result setValue:[self datagramRangeMax] forKey:@"datagramRangeMax"];
    }
    if([self geoBlackList])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self geoBlackList] count]; i++) {
            GeoBlack* item = [[self geoBlackList] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"geoBlackList"];
    }
    if([self ipBlackList])
    {
        [result setValue:[self ipBlackList] forKey:@"ipBlackList"];
    }
    if([self ipWhiteList])
    {
        [result setValue:[self ipWhiteList] forKey:@"ipWhiteList"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.type = [dictionary objectForKey:@"type"];
    self.cleanThresholdBps = [dictionary objectForKey:@"cleanThresholdBps"];
    self.cleanThresholdPps = [dictionary objectForKey:@"cleanThresholdPps"];
    self.spoofIpEnable = [dictionary objectForKey:@"spoofIpEnable"];
    self.srcNewConnLimitEnable = [dictionary objectForKey:@"srcNewConnLimitEnable"];
    self.srcNewConnLimitValue = [dictionary objectForKey:@"srcNewConnLimitValue"];
    self.dstNewConnLimitEnable = [dictionary objectForKey:@"dstNewConnLimitEnable"];
    self.dstNewConnLimitValue = [dictionary objectForKey:@"dstNewConnLimitValue"];
    self.datagramRangeMin = [dictionary objectForKey:@"datagramRangeMin"];
    self.datagramRangeMax = [dictionary objectForKey:@"datagramRangeMax"];
    NSArray* geoBlackListArray = [dictionary objectForKey:@"geoBlackList"];
    if(geoBlackListArray&&![geoBlackListArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [geoBlackListArray count];i++)
        {
            GeoBlack* item = [[GeoBlack alloc]initWithDic:[geoBlackListArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.geoBlackList = propertyArray;
    }
    self.ipBlackList = [dictionary objectForKey:@"ipBlackList"];
    self.ipWhiteList = [dictionary objectForKey:@"ipWhiteList"];
    return self;
}
 @end
@implementation Country
-(id) initWithLabel:(NSString*) label
      value:(NSString*)value
      children:(NSArray<Country*>*)children { 
     self.label = label;               
     self.value = value;               
     self.children = children;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self label])
    {
        [result setValue:[self label] forKey:@"label"];
    }
    if([self value])
    {
        [result setValue:[self value] forKey:@"value"];
    }
    if([self children])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self children] count]; i++) {
            Country* item = [[self children] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"children"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.label = [dictionary objectForKey:@"label"];
    self.value = [dictionary objectForKey:@"value"];
    NSArray* childrenArray = [dictionary objectForKey:@"children"];
    if(childrenArray&&![childrenArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [childrenArray count];i++)
        {
            Country* item = [[Country alloc]initWithDic:[childrenArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.children = propertyArray;
    }
    return self;
}
 @end
 
 


